import request from '@/utils/request'

// 查询借阅管理列表
export function listBorrow(query) {
  return request({
    url: '/system/borrow/list',
    method: 'get',
    params: query
  })
}

// 查询借阅管理详细
export function getBorrow(borrowId) {
  return request({
    url: '/system/borrow/' + borrowId,
    method: 'get'
  })
}

// 新增借阅管理
export function addBorrow(data) {
  return request({
    url: '/system/borrow',
    method: 'post',
    data: data
  })
}

// 修改借阅管理
export function updateBorrow(data) {
  return request({
    url: '/system/borrow',
    method: 'put',
    data: data
  })
}

// 删除借阅管理
export function delBorrow(borrowId) {
  return request({
    url: '/system/borrow/' + borrowId,
    method: 'delete'
  })
}

  // 审批通过
  export function updateApprove(borrowIds) {  
    return request({
      url: '/system/borrow/approve/' + borrowIds,
      method: 'put'
    })
  }

  // 审批拒绝 updateGiveBack
  export function updateReject(borrowIds) {  
    return request({
      url: '/system/borrow/reject/' + borrowIds,
      method: 'put'
    })
  }

  // 实体借阅归还 
  export function updateGiveBack(borrowIds) {  
    return request({
      url: '/system/borrow/giveback/' + borrowIds,
      method: 'put'
    })
  }